﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model.Account;
using Model.Helpers;
using System.ComponentModel.DataAnnotations;

namespace Model.Entities
{
    public class UserVehicle
    {
        [Key]
        public int UserVehicleID { get; set; }
        
        [Required]
        public User User { get; set; }
        
        [Required]
        public Vehicle Vehicle { get; set; }
        
        [Required]
        [StringLength(200)]
        public String ShortDesc { get; set; }
        
        [StringLength(1000)]
        public String LongDesc { get; set; }
        
        [Required]
        public int Year { get; set; }
        
        [Required]
        [Range(1,10)]
        public int State { get; set; }
        public virtual ICollection<Image> Images { get; set; }
        public Location Location { get; set; }
        
        [Required]
        [RegularExpression(@"^([A-Z]{3})([0-9]{3})")]
        public String VehicleIdentifier { get; set; }
        
        [Required]
        [StringLength(20)]
        public String VehicleIdentifierCard { get; set; }
        
        [Required]
        public DateTime VehicleIdCardExpiration { get; set; }
    }
}
